#ifndef _ML_TOOLS_H_
#define _ML_TOOLS_H_
#include "MLCommon.h"
#include <string>
#include <vector>
#include <iostream>
#include <time.h>
#include <wchar.h>
_MYLABLIB_BEGIN

class CMLTools
{
public:
	CMLTools(void);
	~CMLTools(void);

public:
	// String
	static bool IsWhitespaceString(const std::wstring& wstr);
	static bool SplitString(const std::wstring& wstrLine, std::vector<std::wstring>& vStrings, wchar_t delimiter = ' ');
	static bool SplitString(const std::wstring& wstrLine, std::vector<double>& vValues, wchar_t delimiter = ' ');
	static bool GetNextToken(const std::wstring& wstrLine, std::wstring& wszToken);
	inline static bool IsBlankChar(wchar_t wch);

public:
	// System
	static long GetCurrentClock(void);
	static double GetDurationInSecond(long lStartClock, long lFinishClock);
	static long GetCurrentUsedMemorySize(void);
};

inline bool CMLTools::IsBlankChar(wchar_t wch)
{
	return (wch == L' ' || wch == L'\t' || wch == L',' || wch == L'\r');
}

_MYLABLIB_END
#endif
